package com.itheima.app.controller;

import com.itheima.app.manager.AnnouncementManager;
import com.itheima.domain.vo.PageBeanVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

//展示所有公告列表
@RestController
public class AnnouncementController {

    @Autowired
    private AnnouncementManager announcementManager;

    /**
     * 展示所有公告列表
     * @param page
     * @param pageSize
     * @return
     */
    @GetMapping("/messages/announcements")
    public PageBeanVo messagesAnnouncements(
            @RequestParam(defaultValue = "1") Integer page,
            @RequestParam(defaultValue = "10") Integer pageSize
    ){
        return announcementManager.messagesAnnouncements(page,pageSize);
    }
}
